<!-- 吊机员任务 -->
{include file="common:header" /}
{include file="common:side" /}
    <div id="page-wrapper">
      <!--*************************** content部分开始 ******************-->
      <div class="container-fluid m-stacking" id="m_main">
        <div class="row m-t-20 m-title">
          <div class="col-sm-12">
            <div class="white-box">
              <h2 class="box-title">吊机员任务操作控制台</h2>
            </div>
          </div>
        </div>
        <div class="row m-t-20">
          <div class="col-sm-12">
            <div class="white-box">
              <div class="table-responsive">
                <table id="myTable" class="table table-striped color-table info-table">
                  <thead>
                    <tr>
                      <th>任务时间</th>
                      <th>堆放位</th>
                      <th>货箱柜编号</th>
                      <th>配送车辆</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr v-for="(item,index) in dataList">
                      <td>{{item.task_time}}</td>
                      <td>{{item.position_box}}</td>
                      <td>{{item.box_number}}</td>
                      <td>{{item.transport_ship_no}}</td>
                      <td><a class="info m-r-10" href="javascript:void(0)" @click="finishLoading(item.id)">完成已装车</a></td>
                    </tr>
                  </tbody>
                </table>
                <pagination :tr-all="trAll" :page-cur="pageCur" :page-all="pageAll" :page-size="pageSize" @page-to="pageTo" ref="c1"></pagination>
              </div>
            </div>
          </div>
        </div>
        <!-- /.row -->
      </div>
      <!--*************************** content部分结束 ******************-->

      <!-- <footer class="footer text-center"> 2017 &copy; Ample Admin brought to you by themedesigner.in </footer> -->
    </div>
  </div>
  {include file="common:js" /}
  <script type="text/javascript" src="/web/js/search_list.js"></script>
  {include file="common:footer" /}
  {include file="component:pagination" /}

  <script type="text/javascript">
    var vm = new Vue({
      el: '#m_main',
      data() {
        return {
          apiUrl: "",
          searchUrl: "/dashboard/index/crewman_task", //搜索接口
          draw: '', //校验字段
          dataList: [1], //搜索列表数据
          trAll: 0, //数据总数
          pageAll: 0, //页码总数
          pageCur: 1, //当前页
          pageSize: 10, //每页数量
        }
      },
      mounted() {
        this.pageTo(1);
      },
      methods: {
        // 搜索当前页并渲染列表
        pageTo(page) {
          var that = this;
          searchList2(that,page,{},(res)=>{

          },(fail)=>{

          },(error)=>{
          })
        },
        finishLoading(e) {
          axios.post('/dashboard/index/load_car', {id: e},{headers: {'X-Requested-with':'XMLHttpRequest'}}).then(res => {
            // console.log(res);
            if(res.data.ErrorCode == 1){
              //请求成功
              alert(res.data.ErrorMsg);
              this.pageTo(this.pageCur)
            }else{
              alert(res.data.ErrorMsg)
            }
          }).catch(err => {
            console.log(err);
          })
        }
      }
    })
  </script>
